//
//  BrokerDelegate.m
//  Vacations
//
//  Created by User-23 on 11/7/14.
//  Copyright (c) 2014 TrainingCamp. All rights reserved.
//

#import "BrokerDelegate.h"
#import "Vacation.h"

@interface BrokerDelegate ()

@property VacationBook* obj;

@end

@implementation BrokerDelegate


-(void) goOnVacation:(Vacation*) vacation
{
    
}

-(BOOL) isVacation:(Vacation*) vacation openForDay:(NSString*) date
{
    for (NSInteger index = 0; index < [vacation.openDays count]; index++)
    {
        NSLog(@"length: %d", [vacation.openDays count]);
        if ([date isEqual:vacation.openDays[index]]) {
            self.obj = [VacationBook sheredVacationBook];
            [self.obj bookVacation:vacation];
            NSLog(@"YES");
            return YES;
        }
    }
    NSLog(@"NO");
    return NO;
}

-(void) reviewVacation:(Vacation*) vacation
{
    self.obj = [VacationBook sheredVacationBook];
    [self.obj reviewGrow:vacation];
}


@end
